package com.contactbook.web.service;

import java.util.Set;

import contactbook.dao.AccountDAOInterface;
import contactbook.dao.GroupDAOInterface;
import contactbook.model.Group;
import contactbook.service.GroupServiceInterface;

public class GroupClient implements GroupServiceInterface {

	private GroupServiceInterface groupService;
	
	public GroupClient() {
		ServiceLocator sl = ServiceLocator.getInstance();
		groupService = sl.getGroupService();
	}
	
	@Override
	public void login(String login, String password) {
		groupService.login(login, password);
	}
	
	@Override
	public void logout() {
		groupService.logout();
	}
	
	@Override
	public Group add(Group group) {
		return groupService.add(group);
	}
	
	@Override
	public void update(Group group) {
		groupService.update(group);
	}

	@Override
	public void delete(int groupId) {
		groupService.delete(groupId);
	}

	@Override
	public Group getGroupById(int groupId) {
		return groupService.getGroupById(groupId);
	}
	
	@Override
	public Group getGroupByName(String name) {
		return groupService.getGroupByName(name);
	}
	
	@Override
	public Set<Group> getGroups() {
		return groupService.getGroups();
	}
	
	@Override
	public boolean isLogged() {
		return groupService.isLogged();
	}

	@Override
	public void setDAO(GroupDAOInterface groupDao,
			AccountDAOInterface accountDao) {
		groupService.setDAO(groupDao, accountDao);
		
	}
}
